local xiongshu = fk.CreateSkill({
  name = "js__xiongshu",
})

xiongshu:addEffect(fk.CardUseFinished, {
  mute = true,
  anim_type = "negative",
  can_trigger = function(self, event, target, player, data)
    return target and player:hasSkill(xiongshu.name) and data.card.trueName == "slash" and player.room.current == player
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    player.room:addTableMark(target, "@@js__xiongshu-turn")
  end,
})

xiongshu:addEffect(fk.EventPhaseStart, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    local targets = table.filter(player.room.alive_players, function(id)
            return id:getMark("@@js__xiongshu-turn")~=0
    end)
    if player:hasSkill(xiongshu.name) and target == player then
      return player.phase == Player.Finish and #targets ~= 0
    end
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local targets = table.filter(player.room.alive_players, function(id)
        return id:getMark("@@js__xiongshu-turn")~=0
    end)
    local actor = room:askToChoosePlayers(player, {
      targets = targets,
      min_num = 1,
      max_num = 1,
      prompt = "凶竖：你可以令一名本回合使用过【杀】的角色需使用一张手牌，否则你对其造成1点伤害",
      skill_name = xiongshu.name,
      cancelable = true
    })
    if #actor ~= 0 then
      if actor[1]:getCardIds("h")~=0 then
        local use = room:askToUseRealCard(actor[1], {
        pattern = actor[1]:getCardIds("h"),
        skill_name = xiongshu.name,
        prompt = "请可以使用一张手牌，否则 贾充 对你造成一点伤害",
        extra_data = {
            extraUse = true,
            expand_pile = actor[1]:getCardIds("h"),
        },
        })
        if not use then
          room:damage { from = player, to = actor[1], damage = 1, skillName = xiongshu.name, damageType = fk.NormalDamage }
        end
      else
          room:damage { from = player, to = actor[1], damage = 1, skillName = xiongshu.name, damageType = fk.NormalDamage }
      end
        
    end
  end,
})

Fk:loadTranslationTable {
["js__xiongshu"] = "凶竖",
[":js__xiongshu"] = "结束阶段，你可以令一名本回合使用过【杀】的角色需使用一张手牌，否则你对其造成1点伤害。",
["$js__xiongshu1"] = "天下凶凶，由我一人。",
["$js__xiongshu2"] = "成济何在？还不助陛下早登极乐！",
["@@js__xiongshu-turn"] = "凶竖",
}
return xiongshu